# Maintainer: Mike Krüger <mikekrueger81@gmail.com>

pkgname=swagarch-config-system
pkgdesc='SwagArch system config files'
pkgver=0.2.11
pkgrel=1
arch=('any')
url="https://gitlab.com/SwagArch/swagarch-config-system"
license=('GPL')
depends=('sudo>=1.8'
         'polkit>=0.113' 
         'pam>=1.3' 
         'xdg-user-dirs>=0.15' 
         'systemd>=234.11' 
         'blueman'
         'ntp'
         'reflector'
         'lightdm-gtk-greeter-settings'
         'tlp>=1.0'
         'geoip>=1.6'
         'xorg-server>=1.19')
source=("git+$url.git")
sha256sums=('SKIP')
install=$pkgname.install

package() {
    package_path="/etc/$pkgname"
    cd "${srcdir}/${pkgname}"

    install -d ${pkgdir}$package_path/etc/bluetooth/
    install -m644 etc/bluetooth/* "${pkgdir}$package_path/etc/bluetooth/"

    install -d ${pkgdir}$package_path/etc/default/
    install -m644 etc/default/* "${pkgdir}$package_path/etc/default/"

    install -d ${pkgdir}$package_path/etc/lightdm/
    install -m644 etc/lightdm/* "${pkgdir}$package_path/etc/lightdm/"

    install -d ${pkgdir}$package_path/etc/pam.d/
    install -m644 etc/pam.d/* "${pkgdir}$package_path/etc/pam.d/"

    install -d ${pkgdir}$package_path/etc/sudoers.d/
    install -m644 etc/sudoers.d/* "${pkgdir}$package_path/etc/sudoers.d/"
    
    #-------------------------systemd config files--------------
    install -d ${pkgdir}$package_path/etc/systemd/scripts/
    install -m644 etc/systemd/scripts/* "${pkgdir}$package_path/etc/systemd/scripts/"

    install -d ${pkgdir}$package_path/etc/systemd/system/
    install -m644 etc/systemd/system/* "${pkgdir}$package_path/etc/systemd/system/"

    #-------------------------x11 configs-------------------------
    install -d ${pkgdir}$package_path/etc/X11/xorg.conf.d/
    install -m644 etc/X11/xorg.conf.d/* "${pkgdir}$package_path/etc/X11/xorg.conf.d/"
    
    #-------------------------modprobe files-------------------------
    install -d ${pkgdir}$package_path/etc/modprobe.d/
    install -m644 etc/modprobe.d/* "${pkgdir}$package_path/etc/modprobe.d/"

    #-------------------------sysctl.d files-------------------------
    install -d ${pkgdir}$package_path/etc/sysctl.d/
    install -m644 etc/sysctl.d/* "${pkgdir}$package_path/etc/sysctl.d/"

    #-------------------------udev files-------------------------
    install -d ${pkgdir}$package_path/etc/udev/rules.d/
    install -m644 etc/udev/rules.d/* "${pkgdir}$package_path/etc/udev/rules.d/"

    #-------------------------autostart files-------------------------
    install -d ${pkgdir}$package_path/etc/xdg/autostart/
    install -m644 etc/xdg/autostart/* "${pkgdir}$package_path/etc/xdg/autostart/"

    #-------------------------polkit config files----------------------
    install -d ${pkgdir}$package_path/usr/share/polkit-1/actions/
    install -m644 usr/share/polkit-1/actions/* "${pkgdir}$package_path/usr/share/polkit-1/actions/"

    #-------------------------lib config files----------------------
    install -d ${pkgdir}$package_path/usr/lib/
    install -m644 usr/lib/* "${pkgdir}$package_path/usr/lib/"
}
